import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const USER: AppRouteRecordRaw = {
    path: '/device-management',
    name: 'device-management', // 和菜单管理中的component对齐
    component: DEFAULT_LAYOUT,
    meta: {
        locale: 'menu.device.management',
        icon: 'icon-storage',
        requiresAuth: true,
        order: 2,
    },
    children: [
        {
            path: 'product',
            name: 'product',
            component: () =>
                import('@/views/device-management/product/index.vue'),
            meta: {
                locale: 'menu.device.product',
                requiresAuth: true,
                roles: ['*'],
            },
        },
        {
            path: 'product/detail',
            name: 'product-detail',
            component: () =>
                import('@/views/device-management/product/detail.vue'),
            meta: {
                locale: 'menu.device.product.detail',
                requiresAuth: true,
                roles: ['*'],
                hideInMenu: true,
            },
        },
        {
            path: 'device',
            name: 'device',
            component: () =>
                import('@/views/device-management/device/index.vue'),
            meta: {
                locale: 'menu.device.device',
                requiresAuth: true,
                roles: ['*'],
            },
        },
        {
            path: 'device/detail',
            name: 'device-detail',
            component: () =>
                import('@/views/device-management/device/detail.vue'),
            meta: {
                locale: 'menu.device.device.detail',
                requiresAuth: true,
                roles: ['*'],
                hideInMenu: true,
            },
        },
        {
            path: 'device/monitor',
            name: 'device-monitor',
            component: () =>
                import('@/views/device-management/device/monitor.vue'),
            meta: {
                locale: 'menu.device.monitor',
                requiresAuth: true,
                roles: ['*'],
            },
        },
        {
            path: 'alert',
            name: 'alert',
            component: () =>
                import('@/views/device-management/alert/index.vue'),
            meta: {
                locale: 'menu.device.alert',
                requiresAuth: true,
                roles: ['*'],
            },
        },
    ],
};

export default USER;
